package me.liuyu.ymall.member.point.api;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import me.liuyu.ymall.member.point.DO.MemberPointHis;
import me.liuyu.ymall.member.point.service.MemberPointService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author liuyu E-mail: liuyu2783@163.com
 * @Date 2018/6/26 10:03
 * @Descrption
 * @Modified By
 */
@RestController
@RequestMapping
public class MemberPointApi {

    private Logger logger = LoggerFactory.getLogger(MemberPointApi.class);
    @Autowired
    private MemberPointService memberPointService;

    @RequestMapping("listMyPointHis")
    public List listMyPointHis(@RequestParam("memberId") Long memberId){
        logger.info("查询我的积分列表，memberId={}",memberId);
        EntityWrapper<MemberPointHis> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq("member_id", memberId);
        return memberPointService.selectList(entityWrapper);
    }

}
